﻿Imports System.IO

Public Class FormularioCaja

    Private Sub FormularioCaja_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Dim diaRuta As String = "c:/eleemeTPV/caja/" & Today.Day & Today.Month & Today.Year & ".txt"
        Dim mesRuta As String = "c:/eleemeTPV/caja/" & Today.Year & Today.Month & ".txt"
        Dim anhoRuta As String = "c:/eleemeTPV/caja/" & Today.Year & ".txt"
        Dim cajaDia As FileStream = New FileStream(diaRuta, FileMode.OpenOrCreate, FileAccess.Read)
        Dim cajaMes As FileStream = New FileStream(mesRuta, FileMode.OpenOrCreate, FileAccess.Read)
        Dim cajaAnho As FileStream = New FileStream(anhoRuta, FileMode.OpenOrCreate, FileAccess.Read)
        Dim sr As New StreamReader(diaRuta)
        tbDia.Text = sr.ReadLine
        sr.Close()
        sr = New StreamReader(mesRuta)
        tbMes.Text = sr.ReadLine
        sr.Close()
        sr = New StreamReader(anhoRuta)
        tbAnho.Text = sr.ReadLine
        sr.Close()
        cajaDia.Close()
        cajaMes.Close()
        cajaAnho.Close()
    End Sub

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Me.Close()
    End Sub
End Class